#ifndef BLOCK_H
#define BLOCK_H

#include "Base.h";
#include <QtOpenGL>


#define BLOCK_HEIGHT = 0.15;

class Block
{
public:
    Block(){
        this->empty=true;
    }

    Block(double inradius, double outradius, int alpha, int n_points, Point3d bottom_left_out_point, int i, int j){
        this->in_radius=inradius;
        this->out_radius=outradius;
        this->opening_angle=alpha;
        this->num_points=n_points;
        this->empty=false;

        this->i=i;
        this->j=j;

        out_starting_point=bottom_left_out_point;
        out_ending_point=Point3d(out_starting_point.x()+width, out_starting_point.y(), out_starting_point.z());

        in_starting_point=Point3d(out_starting_point.x(), out_starting_point.y(), out_starting_point.z()-thickness);
        in_ending_point=Point3d(out_ending_point.x(), out_ending_point.y(), out_ending_point.z()-thickness);
    }

    Point3d getOut_starting_point () {return out_starting_point;}
    Point3d getOut_ending_point () {return out_ending_point;}
    Point3d getIn_starting_point () {return in_starting_point;}
    Point3d getIn_ending_point () {return in_ending_point;}

    double& getWidth () {return width;}
    double& getThickness () {return thickness;}

    void drawUpperPartialDisk();
    void drawBottomPartialDisk();
    void drawMiddleBand ();

    void drawBlock();

    bool isEmpty() {return empty;}


private:
    Point3d center;

    double in_radius;
    double out_radius;

    int i;
    int j;

    int num_points;
    int opening_angle;
    bool empty;

    //the two points at the bottom
    Point3d out_starting_point; //outer face
    Point3d out_ending_point; //outer face
    Point3d in_starting_point; //inner face
    Point3d in_ending_point; //inner face

    double width;
    double thickness;
};

#endif // BLOCK_H
